package myicesscheduler.web;

public class TimeSlotReservationCommand
{
   private String commandType;
   private int timeSlotId;
   private String reservingPersonName;
   private String reservingPersonEmail;
   private String reservingPersonPhone;
   private String reservingPlace;

   public static final String commandType_Reserve = "reserve";
   public static final String commandType_Cancel = "cancel";

   @Override
   public String toString()
   {
      String rst = "Command type: " + getCommandType() + "; ";
      rst += "time slot id: " + getTimeSlotId() + "; ";
      if( isCommandReservation() )
      {
         rst += "person name: " + getReservingPersonName() + "; ";
         rst += "email: " + getReservingPersonEmail() + "; ";
         rst += "phone: " + getReservingPersonPhone() + "; ";
         rst += "place: " + getReservingPlace() + ";";
      }
      return rst;
   }

   public int getTimeSlotId()
   {
      return timeSlotId;
   }

   public void setTimeSlotId( int timeSlotId )
   {
      this.timeSlotId = timeSlotId;
   }

   public boolean isCommandReservation()
   {
      return getCommandType().equals( commandType_Reserve );
   }

   public boolean isCommandCancelation()
   {
      return getCommandType().equals( commandType_Cancel );
   }

   public String getCommandType()
   {
      return commandType;
   }

   public void setCommandType( String commandType )
   {
      this.commandType = commandType;
   }

   public String getReservingPlace()
   {
      return reservingPlace;
   }

   public void setReservingPlace( String reservedPlace )
   {
      this.reservingPlace = reservedPlace;
   }

   public String getReservingPersonEmail()
   {
      return reservingPersonEmail;
   }

   public void setReservingPersonEmail( String reservedPersonEmail )
   {
      this.reservingPersonEmail = reservedPersonEmail;
   }

   public String getReservingPersonName()
   {
      return reservingPersonName;
   }

   public void setReservingPersonName( String reservedPersonName )
   {
      this.reservingPersonName = reservedPersonName;
   }

   public String getReservingPersonPhone()
   {
      return reservingPersonPhone;
   }

   public void setReservingPersonPhone( String reservedPersonPhone )
   {
      this.reservingPersonPhone = reservedPersonPhone;
   }
}
